using System.Data.Entity.ModelConfiguration;
using Beaker.OpenCube.CubeManager.Model.Entities;

namespace Beaker.OpenCube.CubeManager.Model.Configurations
{
	internal sealed class ServerConfiguration
		: EntityTypeConfiguration<Server>
	{
		public ServerConfiguration()
		{
			HasRequired( s => s.HostingMachine )
				.WithMany( m => m.Servers )
				.Map( map => map.MapKey( "HostingMachineId" ) );

			HasMany( s => s.RoleSets )
				.WithMany();

			ToTable( "Server" );
		}
	}
}